// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 作品交易记录获取 作品交易记录获取 GET /api/auction/${param0} */
export async function getAuction(
  params: {
    // path
    txHash: string;
  },
  options?: { [key: string]: any },
) {
  const { txHash: param0, ...queryParams } = params;
  return request<API.ModelsAuction>(`/api/auction/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 作品交易记录获取 作品交易记录获取 GET /api/auctions/ */
export async function getAuctions(
  params: {
    // query
    pageSize?: number;
    current?: number;
    fileHash: string;
    createTxHash?: string;
    type?: string;
    // path
  },
  options?: { [key: string]: any },
) {
  const { ...queryParams } = params;
  return request<API.ModelsAuctionsResponse>('/api/auctions/', {
    method: 'GET',
    params: {
      ...queryParams,
    },
    ...(options || {}),
  });
}

/** 作品交易记录获取 作品交易记录获取 GET /api/fileStorages/ */
export async function getFileStorages(
  params: {
    // query
    pageSize?: number;
    current?: number;
    fileHash: string;
    // path
  },
  options?: { [key: string]: any },
) {
  const { ...queryParams } = params;
  return request<API.ModelsFileStoragesResponse>('/api/fileStorages/', {
    method: 'GET',
    params: {
      ...queryParams,
    },
    ...(options || {}),
  });
}

/** 作品交易记录获取 作品交易记录获取 GET /api/sales/ */
export async function getSales(
  params: {
    // query
    pageSize?: number;
    current?: number;
    fileHash: string;
    // path
  },
  options?: { [key: string]: any },
) {
  const { ...queryParams } = params;
  return request<API.ModelsSalesResponse>('/api/sales/', {
    method: 'GET',
    params: {
      ...queryParams,
    },
    ...(options || {}),
  });
}
